﻿@model DTOs.ProductDTO
@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script type="text/javascript" src="../../Scripts/tinymce/tiny_mce.js"></script>

<script type="text/javascript">
    <!-- TinyMCE -->
			tinyMCE.init({
				mode : "textareas",
				theme : "advanced",
				editor_selector : "tinyTextArea"
			});
		<!-- /TinyMCE -->
</script>

<div>
<br />
<h1> Add new product</h1>
<br />

@using (Html.BeginForm("Add", "ProductAdmin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<table>
<tr>
<td><label > Category</label></td>
<td>
@Html.DropDownList("CategoryId", (IEnumerable<SelectListItem>) ViewBag.Categories)
</td>
</tr>

<tr>
<td>
@Html.LabelFor(m => m.Name)
</td>
<td>
@Html.TextBoxFor( m => m.Name)
</td>
</tr>

<tr>
<td>
@Html.LabelFor(m => m.Description)
</td>
<td>
<textarea cols=30" rows="4" name="Description"></textarea>

</td>
</tr>

<tr>
<td>Image</td>
<td> <input name="imageFile" type="file" value="select an image" /> </td>
</tr>

<tr>
<td>Price</td>
<td>@Html.TextBoxFor(m => m.Price)</td>
</tr>

<tr>
<td>
<label >Detail </label>
</td>
<td>
<textarea name="detail" cols=30" class="tinyTextArea" ></textarea>
</td>
</tr>

<tr>
<td></td>
<td><input type="submit" value="Save" /></td>
</tr>
</table>
}
</div>